<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
<div></div>
<script>
    var div = document.querySelector("div");
    var startTime,startX,startY;
    div.addEventListener("touchstart",function(e){
        if(e.targetTouches.length > 1) {
            return;
        }
        startTime = Date.now();
        startX = e.targetTouches[0].clientX;
        startY = e.targetTouches[0].clientY;
    })
    div.addEventListener("touchend",function(e){
        if(e.changedTouches.length > 1) {
            return;
        }
        console.log(Date.now()-startTime);
        if(Date.now()-startTime > 150) {
            return;
        }
        var endX = e.changedTouches[0].clientX;
        var endY = e.changedTouches[0].clientY;
        if(Math.abs(endX-startX) < 6 && Math.abs(endY-startY < 6)){
            console.log("这就是移动端的单击事件--tap事件");
        }
    })
   
</script>
</body>
</html>